package cn.com.godliu.oauth2.repositorys;

import cn.com.godliu.oauth2.pojo.Account;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

@ComponentScan
public interface AccountRepository extends CrudRepository<Account, Long> {

    @Query("select u from #{#entityName} u where u.username = ?1")
    Account countAccountByUserName(String userName);

    Account getAccountById(Long id);
}
